Testing Grating

  |   Source   |   Minimap
In [15]:
import numpy as np
np.set_printoptions(precision=3, suppress=True)
import pylab
import matplotlib.pyplot as plt
%matplotlib inline
  Hide output
In [16]:
import MotionClouds as mc
import os
fx, fy, ft = mc.get_grids(mc.N_X, mc.N_Y, mc.N_frame)
#mc.recompute = True
mc.notebook = True
  Hide output
In [17]:
name = 'grating'

#initialize
fx, fy, ft = mc.get_grids(mc.N_X, mc.N_Y, mc.N_frame)
color = mc.envelope_color(fx, fy, ft)

z = color * mc.envelope_gabor(fx, fy, ft)
mc.figures(z, name)
mc.in_show_video(name)
  Hide output
grating

In [18]:
# explore parameters
for sigma_div in [1, 2, 3, 5, 8, 13 ]:
    name_ = name + '-largeband-B_theta-pi-over-' + str(sigma_div).replace('.', '_')
    z = color * mc.envelope_gabor(fx, fy, ft, B_theta=np.pi/sigma_div)
    mc.figures(z, name_)
    mc.in_show_video(name_)
  Hide output
grating-largeband-B_theta-pi-over-1

grating-largeband-B_theta-pi-over-2

grating-largeband-B_theta-pi-over-3

grating-largeband-B_theta-pi-over-5

grating-largeband-B_theta-pi-over-8

grating-largeband-B_theta-pi-over-13

In [19]:
for div in [1, 2, 4, 3, 5, 8, 13, 20, 30]:
    name_ = name + '-theta-pi-over-' + str(div).replace('.', '_')
    z = color * mc.envelope_gabor(fx, fy, ft, theta=np.pi/div)
    mc.figures(z, name_)
    mc.in_show_video(name_)
  Hide output
grating-theta-pi-over-1

grating-theta-pi-over-2

grating-theta-pi-over-4

grating-theta-pi-over-3

grating-theta-pi-over-5

grating-theta-pi-over-8

grating-theta-pi-over-13

grating-theta-pi-over-20

grating-theta-pi-over-30

In [20]:
V_X = 1.0
for sigma_div in [1, 2, 3, 5, 8, 13 ]:
    name_ = name + '-B_theta-pi-over-' + str(sigma_div).replace('.', '_') + '-V_X-' + str(V_X).replace('.', '_')
    z = color * mc.envelope_gabor(fx, fy, ft, V_X=V_X, B_theta=np.pi/sigma_div)
    mc.figures(z, name_)
    mc.in_show_video(name_)
  Hide output
grating-B_theta-pi-over-1-V_X-1_0

grating-B_theta-pi-over-2-V_X-1_0

grating-B_theta-pi-over-3-V_X-1_0

grating-B_theta-pi-over-5-V_X-1_0

grating-B_theta-pi-over-8-V_X-1_0

grating-B_theta-pi-over-13-V_X-1_0

In [21]:
for B_sf in [0.05, 0.1, 0.15, 0.2, 0.3, 0.4, 0.8]:
    name_ = name + '-B_sf-' + str(B_sf).replace('.', '_')
    z = color * mc.envelope_gabor(fx, fy, ft, B_sf=B_sf)
    mc.figures(z, name_)
    mc.in_show_video(name_)
  Hide output
grating-B_sf-0_05

grating-B_sf-0_1

grating-B_sf-0_15

grating-B_sf-0_2

grating-B_sf-0_3

grating-B_sf-0_4

grating-B_sf-0_8

Comments powered by Disqus
    Share